using MyApi.Entity;
using Microsoft.EntityFrameworkCore;
{

}
namespace MyApi.Data
{
    public class EntityDb : DbContext
    {
        public EntityDb(DbContextOptions options) : base(options)
        {

        }
        //用户表
        public DbSet<User> Users { get; set; }
        //角色表
        public DbSet<Roles> Roles { get; set; }
        //用户角色表
        public DbSet<UserRoles> UserRoles { get; set; }

        //连接字符串
        protected override void OnConfiguring(DbContextOptionsBuilder options) =>
        options.UseSqlServer(@"server=.;uid=sa;pwd=123456;database=MyApi");
    }
}